import server from './myAxios/interceptors'
//所有权限列表(list)
export const getAllRights=(type='list')=>{
    return server.request({
        url:`rights/${type}`,
        method:'get'
    });
}
//所有角色列表
export const getAllRoles=()=>{
    return server.request({
        url:'roles',
        method:'get'
    });
}
//角色授权
export const postUpdateRights=(data)=>{
    return server.request({
        url:`roles/${data.roleId}/rights`,
        method:'post',
        data:{rids: data.rids}
    });
}
//删除角色指定权限
export const deleteRolesRights=(data)=>{
    return server.request({
        url:`roles/${data.roleId}/rights/${data.rightId}`,
        method:'delete',
    });
}
